home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 March: Reference Library / Dev.CD Mar 96 RL / Dev.CD Mar 96 RL.toast / Technical Documentation / develop / develop Issue 25 / develop Issue 25 code / QD3D to QTVR / ArticleCode / Source / object.c < prev    next >
Encoding:
C/C++ Source or Header  |  1995-11-21  |  1.5 KB  |  39 lines  |  [TEXT/MPCC]

  1. #include "QD3DtoQTVR.h"
  2. #include "extern.h"
  3. #include "object.h"
  4. #include "draw.h"
  5.  
  6. void MyRotateObjectX(DocumentPtr theDocument,float angle)
  7. {
  8.     TQ3Matrix4x4        tempMatrix;
  9.     
  10.     Q3Matrix4x4_SetTranslate(&tempMatrix,-theDocument->documentGroupCenter.x,
  11.             -theDocument->documentGroupCenter.y,-theDocument->documentGroupCenter.z);
  12.     Q3Matrix4x4_Multiply(&theDocument->modelRotation, &tempMatrix, &theDocument->modelRotation);
  13.     
  14.     Q3Matrix4x4_SetRotate_XYZ(&tempMatrix, angle, 0.0, 0.0);
  15.     Q3Matrix4x4_Multiply(&theDocument->modelRotation, &tempMatrix, &theDocument->modelRotation);
  16.     
  17.     Q3Matrix4x4_SetTranslate(&tempMatrix,theDocument->documentGroupCenter.x,
  18.             theDocument->documentGroupCenter.y,theDocument->documentGroupCenter.z);
  19.     Q3Matrix4x4_Multiply(&theDocument->modelRotation, &tempMatrix, &theDocument->modelRotation);
  20. }
  21.  
  22. void MyRotateObjectY(DocumentPtr theDocument,float angle)
  23. {
  24.     TQ3Matrix4x4        tempMatrix;
  25.     
  26.     Q3Matrix4x4_SetTranslate(&tempMatrix,-theDocument->documentGroupCenter.x,
  27.             -theDocument->documentGroupCenter.y,-theDocument->documentGroupCenter.z);
  28.     Q3Matrix4x4_Multiply(&theDocument->modelRotation, &tempMatrix, &theDocument->modelRotation);
  29.     
  30.     Q3Matrix4x4_SetRotate_XYZ(&tempMatrix, 0.0, angle, 0.0);
  31.     Q3Matrix4x4_Multiply(&theDocument->modelRotation, &tempMatrix, &theDocument->modelRotation);
  32.     
  33.     Q3Matrix4x4_SetTranslate(&tempMatrix,theDocument->documentGroupCenter.x,
  34.             theDocument->documentGroupCenter.y,theDocument->documentGroupCenter.z);
  35.     Q3Matrix4x4_Multiply(&theDocument->modelRotation, &tempMatrix, &theDocument->modelRotation);
  36. }
  37.  
  38.  
  39.